package com.ishansong.ticket.service;

import com.ishansong.ticket.exception.ServiceDaoException;
import com.ishansong.ticket.exception.ServiceException;
import com.ishansong.ticket.model.TicketRecord;

import java.util.List;

public interface TicketRecordService {

	/**
	 * 获取操作记录
	 * @param id id
	 * @return TicketRecord
	 * @throws ServiceDaoException
	 * @throws ServiceException
	 */
	TicketRecord getTicketRecord(Long id) throws ServiceDaoException, ServiceException;

	/**
	 * 保存操作记录
	 * @param ticketRecord 操作记录
	 * @return Long
	 * @throws ServiceDaoException
	 * @throws ServiceException
	 */
	Long saveTicketRecord(TicketRecord ticketRecord) throws ServiceDaoException, ServiceException;

	/**
	 * 修改操作记录
	 * @param ticketRecord 操作记录
	 * @throws ServiceDaoException
	 * @throws ServiceException
	 */
	void updateTicketRecord(TicketRecord ticketRecord) throws ServiceDaoException, ServiceException;

    /**
     * 删除操作记录
     * @param id id
     * @return Boolean
     * @throws ServiceDaoException
     * @throws ServiceException
     */
	Boolean deleteTicketRecord(Long id) throws ServiceDaoException, ServiceException;

	/**
	 * 根据工单id查看操作记录
	 * @param ticketId 工单id
	 * @return List<TicketRecord>
	 * @throws ServiceDaoException
	 * @throws ServiceException
	 */
	List<TicketRecord> queryTicketRecordsByTicketId(long ticketId) throws ServiceDaoException, ServiceException;

	/**
	 * 获取我的工单数据
	 * @param ticketId     工单id
	 * @param operatorId   操作人ID
	 * @return TicketRecord
	 * @throws ServiceDaoException
	 * @throws ServiceException
	 */
	TicketRecord queryTicketRecordsByTicketIdAndOperatorId(long ticketId,String operatorId,int status) throws ServiceDaoException, ServiceException;

	/**
	 * 根据状态和操作人的ID获取我的工单列表
	 * @param operatorId  操作人
	 * @param status      状态
	 * @return List<TicketRecord>
	 * @throws ServiceDaoException
	 * @throws ServiceException
	 */
	List<TicketRecord> queryTicketRecordsByOperatorIdAndStatus(String operatorId,int status) throws ServiceDaoException, ServiceException;

	/**
	 * 获取我的工单数量
	 * @param status       状态
	 * @param operatorId   操作人
	 * @param time         时间
	 * @return int
	 * @throws ServiceDaoException
	 * @throws ServiceException
	 */
	int queryTicketMyCountByStatus(Integer status,String operatorId,String time) throws ServiceDaoException, ServiceException;

}
